﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using YunBox2.Contracts;
using YunBox2.Contracts.Core;

namespace YunBox2.DAL.Maps
{
    internal class CompanyProfileMap : ClassMap<CompanyProfile>
    {
        public CompanyProfileMap()
        {
            Id(x => x.Id).GeneratedBy.Guid().Default("(newid())").Column("Id");
            Map(x => x.Name).Length(250).Column("FullName");
            Map(x => x.ShortName).Length(32).Column("ShortName");
            Map(x => x.LawPerson).Length(32).Column("LawPerson");
            Map(x => x.Bank).Length(250).Column("Bank");
            Map(x => x.BankAccount).Length(36).Column("BankAccount");

            Map(x => x.LastModifiedTime).Column("LastModifiedTime");
            References(x => x.LastModifiedUser).Column("LastModifiedUserID").Not.Nullable();

            Table("CompanyProfile");
        }
    }
}